#include <iostream>

#include <iostream>

using namespace std;
int N;
const int Max_N = 1e4 + 1;
int i = 0;
int A[Max_N], B[Max_N];
int V_max, V_min;
bool check_min(int mid)
{
	for (int i = 0; i < N; i++)
	{
		if (A[i] / mid > B[i])
			return false;
	}
	return true;
}
bool check_max(int mid)
{
	for (int i = 0; i < N; i++)
	{
		if (A[i] / mid < B[i])
			return false;
	}
	return true;
}
int main()
{
	/*int i = 0;
	cin >> N;
	while (N--)
	{
		scanf("%d %d", &A[i], &B[i]);
		int ans = A[i] / B[i];
		if (ans < _max)
			_max = ans;
	}
	cout << _min << " " << _max;*/
	cin >> N;
	for(int i=0;i<N;i++)
	{
		scanf("%d %d", &A[i], &B[i]);
	}
	int L = 1, R = 1e9;

	while (L <= R)
	{
		int mid = L + R >> 1;
		if (check_min(mid))
		{
			V_min = mid;
			R = mid - 1;
		}
		else
			L = mid + 1;
	}
	L = 1, R = 1e9;

	while (L <= R)
	{
		int mid = L + R >> 1;
		if (check_max(mid))
		{
			V_max = mid;
			L = mid + 1;
		}
		else
			R = mid - 1;
	}
	cout << V_min << " " << V_max;
	return 0;
}
